// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef PLATFORM_SYSTEM_RUN_H
#define PLATFORM_SYSTEM_RUN_H

#include <string>
#include <vector>
#include <optional>

#include "Path.h"
#include "EnvironmentVariable.h"

namespace Platform::System {

struct ProcessResult {
    bool success;
    int exitCode;
    std::vector<std::string> output;
};

ProcessResult Run(const std::string &cmd,
                  std::optional<Path> workingDir,
                  std::optional<std::vector<EnvironmentVariable>> extraEnvVars);

} // namespace Platform::System

#endif // PLATFORM_SYSTEM_RUN_H
